home *** CD-ROM | disk | FTP | other *** search
- unit FileAssocU2;
-
- interface
-
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- StdCtrls, ComCtrls, StdActns, ActnList, Menus, ImgList;
-
- type
- TChildForm = class(TForm)
- RichEdit: TRichEdit;
- procedure FormClose(Sender: TObject; var Action: TCloseAction);
- private
- { Private declarations }
- public
- FileName: String;
- constructor Create(AOwner: TComponent; const AFileName: String); reintroduce;
- end;
-
- var
- ChildForm: TChildForm;
-
- implementation
-
- {$R *.DFM}
-
- { TChildForm }
-
- constructor TChildForm.Create(AOwner: TComponent; const AFileName: String);
- begin
- inherited Create(AOwner);
- FileName := AFileName;
- if FileName <> '' then
- RichEdit.Lines.LoadFromFile(FileName);
- Caption := FileName
- end;
-
- procedure TChildForm.FormClose(Sender: TObject; var Action: TCloseAction);
- begin
- Action := caFree
- end;
-
- end.
-